﻿
using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace hslDomo
{
    internal class Program
    {
        static void Main(string[] args)
        {
            ModbusRtuSlaveStation modbusTcpServer = new ModbusRtuSlaveStation(2, "Com2", 9600, 8, StopBits.One, Parity.Even, "ABCD");
            modbusTcpServer.Open();
            modbusTcpServer.Write<int>(3, 0, 100);
            int[] a =new int[] { 100, 999, 80, 8888 };
            modbusTcpServer.Write<int[]>(3, 0, a);
            Console.ReadLine();
            short a1 = modbusTcpServer.Read<short>(3, 4);
            Console.ReadLine();
        }
    }
}
